//
//  NewsPersonalRequest.m
//  Keping
//
//  Created by a on 2017/9/23.
//  Copyright © 2017年 柯平. All rights reserved.
//

#import "NewsPersonalRequest.h"

@implementation NewsPersonalRequest
-(NSString *)requestUrl
{
    return KCommunityRecommandLetterURL;
}

-(KRequestMethod)requestMethod
{
    return KRequestMethodGET;
}

-(id)requestArgument
{
    return self.params;
}

-(NSDictionary<NSString *,NSString *> *)requestHeaderFieldValueDictionary
{
    return @{@"Cookie":[KAppConfig sharedConfig].sessionId?:@""};
}
@end

@implementation NewsStarRequest

-(NSString *)requestUrl
{
    return KNewStarURL;
}

-(KRequestMethod)requestMethod
{
    return KRequestMethodGET;
}

-(id)requestArgument
{
    return self.params;
}

-(NSDictionary<NSString *,NSString *> *)requestHeaderFieldValueDictionary
{
    return @{@"Cookie":[KAppConfig sharedConfig].sessionId?:@""};
}
@end

@implementation CleanNewsStarRequest

-(NSString *)requestUrl
{
    return KCleanNewStarURL;
}

-(KRequestMethod)requestMethod
{
    return KRequestMethodGET;
}

-(id)requestArgument
{
    return self.params;
}

-(NSDictionary<NSString *,NSString *> *)requestHeaderFieldValueDictionary
{
    return @{@"Cookie":[KAppConfig sharedConfig].sessionId?:@""};
}
@end

@implementation NewsPersonalDetailRequest {
    NSString *requestURL;
}

-(instancetype)initWithNewPersonalId:(NSString *)newpersonalid
{
    if (![newpersonalid isNotBlank]) return nil;
    if (self == [super init]) {
        NSString* url = [NSString stringWithFormat:@"%@",KNewPersonalDetailURL];
        if ([url containsString:@"{entityId}"]) {
            url = [url stringByReplacingOccurrencesOfString:@"{entityId}" withString:newpersonalid];
        }
        requestURL = url;
    }
    return self;
}

-(NSString *)requestUrl
{
    return requestURL;
}

-(KRequestMethod)requestMethod
{
    return KRequestMethodGET;
}

-(id)requestArgument
{
    return self.params;
}

-(NSDictionary<NSString *,NSString *> *)requestHeaderFieldValueDictionary
{
    return @{@"Cookie":[KAppConfig sharedConfig].sessionId?:@""};
}
@end


